<?php

class XRouter {
	public $controller, $action, $params;
	
	public function __construct () {
		$req = $_GET['x'];
		$req = rtrim($req, '/');
		$req = explode('/', $req);
		
		$this->controller = $req[0];
		$this->action     = $req[1].'Action';
		$this->params     = array_slice($req, 2);
	}
	
	public function getController () {
		return $this->controller;
	}
	
	public function getAction () {
		return $this->action;
	}
	
	public function getParams () {
		return $this->params;
	}
}